package com.hippo.core.ui.compose.home

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.hippo.core.R
import com.hippo.core.core.ext.click
import com.hippo.core.ui.components.VerticalSpacer
import com.hippo.core.ui.theme.ColorTextBlack
import com.hippo.core.ui.theme.HippoTheme
import com.hippo.core.ui.theme.PaddingBody

@Composable
fun HomeEmpty(modifier: Modifier = Modifier,onAddClick: () -> Unit) {

    Box(
        contentAlignment = Alignment.Center,
        modifier = modifier.fillMaxSize()
            .padding(PaddingBody)
    ) {



        Column{

            Image(
                modifier = Modifier
                    .size(60.dp)
                    .align(Alignment.CenterHorizontally)
                    .click { onAddClick() },
                painter = painterResource(id = R.mipmap.home_add),
                contentDescription = "Empty State"
            )

            VerticalSpacer(30.dp)

            Text(
                modifier = Modifier.align(Alignment.CenterHorizontally),
                text = stringResource(R.string.home_1),
                style = TextStyle(
                    fontWeight = FontWeight.Bold,
                    fontSize = 16.sp
                ),
                color = ColorTextBlack
            )

            VerticalSpacer(30.dp)

            Text(
                modifier = Modifier.align(Alignment.CenterHorizontally),
                text = stringResource(R.string.home_2),
                fontSize = 12.sp,
                color = ColorTextBlack,
                textAlign = TextAlign.Center
            )


        }

    }

}

@Preview(showBackground = true)
@Composable
private fun HomeEmptyPreview() {
    HippoTheme {
        HomeEmpty(){}
    }
}